<template>
	<view>
		<!-- 客服弹框 -->
		<u-popup :show="kfshow" @close="kfclose" mode="center" :round="10">
			<view class="" style="padding:80rpx 150rpx;min-width: 600rpx;box-sizing: border-box;">
				<view class="bigtext fonweight xiaohei textcenter">在线客服</view>
				<view class="bigtext fonweight xiaolan webxhx margin_top2 textcenter"
					@click="callphonenum=systeminfo.omlinekf_tel;onPhone()">{{systeminfo.omlinekf_tel}}</view>
				<view class="bigtext fonweight xiaolan textcenter margin_top6"
					@click="copy(systeminfo.omlinekf_tel);kfshow=false">复制</view>
			</view>
		</u-popup>
		<!-- 合作弹框 -->
		<u-popup :show="hzshow" @close="hzclose" mode="center" :round="10">
			<view class="" style="padding:80rpx 150rpx;min-width: 600rpx;box-sizing: border-box;">
				<view class="bigtext fonweight xiaohei textcenter">申请合作</view>
				<view class="bigtext fonweight xiaolan webxhx margin_top2 textcenter"
					@click="callphonenum=systeminfo.applyhz_tel;onPhone()">{{systeminfo.applyhz_tel}}</view>
				<view class="bigtext fonweight xiaolan textcenter margin_top6"
					@click="copy(systeminfo.applyhz_tel);hzshow=false">复制</view>
			</view>
		</u-popup>
		<!-- 右侧弹出层 -->
		<u-popup :show="show" @close="close" mode="right">
			<view class="" style="padding:130rpx 48rpx 0;">
				<view class="" style="width: 350rpx;">
					<view class="xiahuaxian">
						<view class="flexleft" @click="jumper('/pages_mypage/wodedingd')">
							<image class="margin_right3 tcicopn" src="../static/image/system/dd.png" mode=""></image>
							<view class="ershiba">我的订单</view>
						</view>
						<view class="flexleft margin_top5" @click="jumper('/pages_mypage/wodeqianbao')">
							<image class="margin_right3 tcicopn" src="../static/image/system/qb.png" mode=""></image>
							<view class="ershiba">我的钱包</view>
						</view>
						<view class="flexleft margin_top5" @click="jumper('/pages_mypage/youhuiq')">
							<image class="margin_right3 tcicopn" src="../static/image/system/yhq1.png" mode=""></image>
							<view class="ershiba">我的优惠券</view>
						</view>
					</view>
					<view class="xiahuaxian margin_top5">
						<view class="flexleft" @click="rzplg()">
							<image class="margin_right3 tcicopn" src="../static/image/system/rzplg.png" mode=""></image>
							<view class="ershiba">官方认证</view>
						</view>
						<view class="flexleft margin_top5" @click="jumper('/pages_mypage/wodeliwu')" v-if="!isSH">
							<image class="margin_right3 tcicopn" src="../static/image/system/lw.png" mode=""></image>
							<view class="ershiba">我的礼物</view>
						</view>
						<view class="flexleft margin_top5" v-if="userInfo.is_fy==1"
							@click="jumper('/pages_mypage/yaoqinghy')">
							<image class="margin_right3 tcicopn" src="../static/image/system/yqhy.png" mode=""></image>
							<view class="ershiba">邀请好友</view>
						</view>
						<!-- <view class="flexleft margin_top5" v-if="userInfo.is_fy==1" @click="jumper('/pages_mypage/tuanduicz')"> -->
						<view class="flexleft margin_top5" v-if="userInfo.is_fy==1" @click="tdcz()">
							<image class="margin_right3 tcicopn" src="../static/image/system/xffl.png" mode=""></image>
							<view class="ershiba">团队充值</view>
						</view>
						<view class="flexleft margin_top5" v-if="userInfo.is_fy==1" @click="jumper('/pages_mypage/shouyi')">
							<image class="margin_right3 tcicopn" src="../static/image/system/xffl.png" mode=""></image>
							<view class="ershiba">团队收益</view>
						</view>
						<view class="flexleft margin_top5" @click="jumper('/pages_mypage/fujindr')">
							<image class="margin_right3 tcicopn" src="@/static/image/system/fujin.png" mode=""></image>
							<view class="ershiba">附近的人</view>
						</view>
						<!-- <view class="flexleft margin_top5">
							<image class="margin_right3 tcicopn" src="../static/image/system/xffl.png" mode=""></image>
							<view class="ershiba">消费返利</view>
						</view> -->
					</view>
					<view class="xiahuaxian margin_top5">
						<view class="flexleft" @click="jumper('/pages_mypage/dizhiguanli')">
							<image class="margin_right3 tcicopn" src="../static/image/system/shdz.png" mode=""></image>
							<view class="ershiba">收货地址</view>
						</view>
						<view class="flexleft margin_top5" @click="tzkztk">
							<image class="margin_right3 tcicopn" src="../static/image/system/hz.png" mode=""></image>
							<view class="ershiba">申请合作</view>
						</view>
						<view class="flexleft margin_top5" @click="dkkft">
							<image class="margin_right3 tcicopn" src="../static/image/system/kf.png" mode=""></image>
							<view class="ershiba">在线客服</view>
						</view>
						<view class="flexleft margin_top5" @click="jumper('/pages_mypage/shezhi')">
							<image class="margin_right3 tcicopn" src="../static/image/system/sz.png" mode=""></image>
							<view class="ershiba">设置</view>
						</view>
					</view>
				</view>
			</view>
		</u-popup>
		<view class="" style="padding-bottom: 130rpx;">
			<!-- 头部 -->
			<view class="toubox dingwei">
				<view class="zuytu">
					<image src="../static/image/system/zybjt.png" mode=""></image>
				</view>
				<view class="flexright dingbu" @click="show = true">
					<view class="">
						<image class="dbicon" src="../static/image/system/dk.png" mode=""></image>
					</view>
				</view>
			</view>
			<!-- 滚动头部 -->
			<view class="nav" :style="'background-color: rgba(255, 255, 255,' + op +')'" v-if="op==1">
				<view class="status-bar" :style="'height:' + statusBarHeight + 'px'"></view>
				<view class="mainpadding2 flexbetween" :style="'color: rgba(0, 0, 0,' + op +')'">
					<view class="" style="width: 28rpx;"></view>
					<view class="sanshier hei_text bold">{{userInfo.nickname}}</view>
					<view class="" style="width: 28rpx;"></view>
				</view>
			</view>
			<view class="baibox ">
				<view class="mainpadding">
					<view class="flexleft">
						<image class="touxiang margin_right3" :src="userInfo.avatar_text" mode=""></image>
						<view class="jbzlbtn flexcenter" @click="jumper('/pages_mypage/bianjiziliao')">
							<view class="margin_right1">
								<u-icon name="edit-pen" color="#333333" size="22"></u-icon>
							</view>
							<view class="ershiba margin_right1">编辑资料</view>
							<!-- <view class="ershiba xiaohui">70%</view> -->
						</view>
					</view>
					<view class=" margin_top ">
						<view class="xiahuaxian">
							<view class="flexleft">
								<view class="xiaohei fonweight margin_right2" style="font-size: 48rpx;">
									{{userInfo.nickname}}
								</view>
								<u-icon name="checkmark-circle-fill" color="#ff0000" size="20"
									v-if="userInfo.is_plg"></u-icon>
								<!-- <view class="xlbtn xiaolan smalltext margin_right1 flexcenter" v-if="userInfo.is_plg">陪聊官
								</view> -->
							</view>
							<view class="flexleft margin_top2" @click="copy(userInfo.idno)">
								<view class="xiaohui strongtext margin_right1">ID号:{{userInfo.idno}}</view>
								<image class="fuzhi" src="../static/image/system/fz.png" mode=""></image>
							</view>
							<view class="flexleft margin_top">
								<view class="flexcenter sanshis huibtn margin_right3"
									@click="jumper('/pages_mypage/wodeqianbao')">
									<image class="qbicon margin_right1" src="../static/image/system/qb.png" mode="">
									</image>
									<view class="">我的钱包</view>
								</view>
								<!-- <view class="flexcenter sanshis huibtn">
									<image class="qbicon margin_right1" src="../static/image/system/shjf.png" mode="">
									</image>
									<view class="">生活缴费</view>
								</view> -->
								<view class="flexcenter sanshis huibtn" @click="jumper('/pages_mypage/fujindr')">
									<image class="qbicon margin_right1" src="@/static/image/system/fujin.png" mode="">
									</image>
									<view class="">附近的人</view>
								</view>
							</view>
						</view>
						<view class="xiahuaxian">
							<!--个人简介 -->
							<view class="">
								<view class="margin_top ershiba xiaohei" v-if="userInfo.bio==''"
									@click="jumper('/pages_mypage/xiugaijj')">你还没有填写个人简介，点击添加...</view>
								<view class="margin_top ershiba xiaohui" v-if="userInfo.bio">{{userInfo.bio}}</view>
								<view class="flexleft  flex_wrap">
									<view class="xhbtn flexcenter margin_top margin_right1">
										<image class="zhixiang margin_right1" v-if="userInfo.gender==0"
											src="../static/image/system/zx.png" mode=""></image>
										<image class="zhixiang margin_right1" v-if="userInfo.gender==1"
											src="../static/image/system/nvicon.png" mode=""></image>
										<view class="smalltext xiaohui">{{userInfo.age}}岁</view>
									</view>
									<view class="xhbtn flexcenter margin_top margin_right1"
										v-for="(item,index) in userInfo.user_flag_names" :key="index">
										<view class="smalltext xiaohui">{{item}}</view>
									</view>
									<view class="xhbtn flexcenter margin_top margin_right1"
										@click="jumper('/pages_mypage/xuanzebq')">
										<view class=" margin_right1">
											<u-icon name="plus" color="#949494" size="11"></u-icon>
										</view>
										<view class="smalltext xiaohui">添加年龄、喜好标签</view>
									</view>
								</view>
							</view>
							<view class="flexleft margin_top">
								<view class="flexleft margin_right2">
									<view class="sanshier fonweight margin_right1">{{userInfo.dz_num}}</view>
									<view class="smalltext xiaohui margin_right1">获赞</view>
								</view>
								<view class="flexleft margin_right2" @click="tzgywm(0)">
									<view class="sanshier fonweight margin_right1">{{userInfo.mygz_num}}</view>
									<view class="smalltext xiaohui margin_right1">关注</view>
								</view>
								<view class="flexleft" @click="tzgywm(1)">
									<view class="sanshier fonweight margin_right1">{{userInfo.myfs_num}}</view>
									<view class="smalltext xiaohui margin_right1">粉丝</view>
								</view>
							</view>
						</view>
					</view>
					<view class="tab_nav">
						<view class="navTitle" v-for="(item,index) in navList" :key="index">
							<view :class="{'active':isActive == index}" @click="checked(index)">
								{{item.title}}
							</view>
						</view>
					</view>
				</view>
				<!-- 作品 -->
				<view class="" v-if="isActive == 0">
					<view class="flexleft flex_wrap">
						<view class="videobox flexcenter" v-for="item in myAll[0].list.data" :key="item.id"
							@click="shipin(item.id,item.user_id)">
							<image :src="item.video_url_text+'?x-oss-process=video/snapshot,t_10000,m_fast'" mode="">
							</image>
							<view class="videocontent flexleft">
								<u-icon name="play-right" color="#fff" size="15"></u-icon>
								<view class="xiaobai smalltext">{{item.view_num}}</view>
							</view>
						</view>
					</view>
				</view>
				<!-- 动态 -->
				<view class="mainpadding2" v-if="isActive == 1">
					<view class="margin_top" v-for="item in myAll[1].list.data" :key="item.id" @click="tzdtxq(item.id)">
						<view class="flexbetween">
							<view class="flexleft">
								<image class="margin_right1 xiaotux" :src="item.user.avatar_text" mode=""></image>
								<view class="">
									<view class="ershiba xiaohei">{{item.user.nickname}}</view>
									<view class="smalltext xiaohui margin_top1">{{item.createtime_text}}</view>
								</view>
							</view>
							<view class="xiaohong smalltext" style="border: 1rpx solid #ff0000; padding: 3rpx 10rpx;"
								@click.stop="trashdt(item.id)">删除</view>
						</view>
						<view class="flexleft margin_top" v-if="item.qwdx">
							<u-icon name="heart-fill" color="#ff0000" size="20"></u-icon>
							<view class=" sanshier xiaohei">期望<text v-if="qingshaonian!=1">对象</text>：{{item.qwdx}}</view>
						</view>
						<view class="margin_top sanshier xiaohei">{{item.content}}</view>
						<view class="flexleft flex_wrap">
							<view class="sanshis flexcenter margin_top" v-for="(ite,inde) in item.images_text"
								:key="inde">
								<image class="dtbabb" :src="ite" mode=""></image>
							</view>
						</view>
						<view class="flexbetween margin_top">
							<view class="ershiw flexcenter">
								<view class="flexleft">
									<view class="dticon">
										<image src="../static/image/system/s.png" mode=""></image>
									</view>
									<view class="smalltext xiaohei">{{item.zs_num}}</view>
								</view>
							</view>
							<view class="ershiw flexcenter">
								<view class="flexleft">
									<view class="dticon">
										<image src="../static/image/system/fx.png" mode=""></image>
									</view>
									<view class="smalltext xiaohei">{{item.share_num}}</view>
								</view>
							</view>
							<view class="ershiw flexcenter">
								<view class="flexleft">
									<view class="dticon">
										<image src="../static/image/system/xx.png" mode=""></image>
									</view>
									<view class="smalltext xiaohei">{{item.comment_num}}</view>
								</view>
							</view>
							<view class="ershiw flexcenter">
								<view class="flexleft">
									<view class="dticon">
										<image src="@/static/image/system/dzs.png" mode="" v-if="item.is_dz==1"></image>
										<image src="@/static/image/system/dz.png" mode="" v-else></image>
									</view>
									<view class="smalltext xiaohei">{{item.dz_num}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="margin_top strongtext xiaohui textcenter">已经到底了哦~</view>
				</view>
				<!-- 收藏 -->
				<view class="" v-if="isActive == 2">
					<!-- 切换tab -->
					<view class="flexleft mainpadding2">
						<view :class="current==1?'nofocustext margin_right3':'focustext margin_right3'"
							@click="selectab(1)">视频</view>
						<!-- <view :class="current==2?'nofocustext margin_right3':'focustext margin_right3'"
							@click="selectab(2)">动态</view> -->
						<view :class="current==3?'nofocustext margin_right3':'focustext margin_right3'"
							@click="selectab(3)">商品</view>
					</view>
					<view class="" v-if="current == 1">
						<view class="flexleft flex_wrap">
							<view class="videobox flexcenter" v-for="item in myAll[2].list.data" :key="item.id"
								@click="shipin(item.video.id,item.video.user_id)">
								<image :src="item.video.video_url_text+'?x-oss-process=video/snapshot,t_10000,m_fast'"
									mode=""></image>
								<view class="videocontent flexleft">
									<u-icon name="heart" color="#fff" size="15"></u-icon>
									<view class="xiaobai smalltext">{{item.video.dz_num}}</view>
								</view>
							</view>
						</view>
					</view>
					<!-- 商品 -->
					<view class=" mainpadding2" v-if="current == 3">
						<view class="margin_top" v-for="item in myAll[4].list.data" :key="item.id"
							@click="tzspxq(item.goods.id)">
							<view class="flexbetween">
								<image class="sptup" :src="item.goods.image_text" mode=""></image>
								<view class="" style="width: 80%;">
									<view class="sanshier xiaohei fonweight yhxk">{{item.goods.title}}</view>
									<view class="strongtext xiaohui margin_top1">已售{{item.goods.sales}}件</view>
									<view class="ershiba xiaohong margin_top1">￥{{item.goods.price}}</view>
								</view>
							</view>
						</view>
						<view class="margin_top strongtext xiaohui textcenter ">已经到底了哦~</view>
					</view>
				</view>
				<!-- 喜欢 -->
				<view class="" v-if="isActive == 3">
					<view class="flexleft mainpadding2">
						<view :class="current==1?'nofocustext margin_right3':'focustext margin_right3'"
							@click="selectab(1)">视频</view>
						<view :class="current==2?'nofocustext margin_right3':'focustext margin_right3'"
							@click="selectab(2)">动态</view>
					</view>
					<view class="" v-if="current == 1">
						<view class="flexleft flex_wrap">
							<view class="videobox flexcenter" v-for="item in myAll[5].list.data" :key="item.id"
								@click="shipin(item.video.id,item.video.user_id)">
								<image :src="item.video.video_url_text+'?x-oss-process=video/snapshot,t_10000,m_fast'"
									mode=""></image>
								<view class="videocontent flexleft">
									<u-icon name="heart" color="#fff" size="15"></u-icon>
									<view class="xiaobai smalltext">{{item.video.dz_num}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="mainpadding2" v-if="current == 2">
						<view class="margin_top" v-for="item in myAll[6].list.data" :key="item.id"
							@click="tzdtxq(item.id)">
							<view class="flexleft">
								<image class="margin_right1 xiaotux" :src="item.userdt.user.avatar_text" mode="">
								</image>
								<view class="">
									<view class="ershiba xiaohei">{{item.userdt.user.nickname}}</view>
									<view class="smalltext xiaohui margin_top1">{{item.userdt.createtime_text}}</view>
								</view>
							</view>
							<view class="flexleft margin_top" v-if="item.userdt.qwdx">
								<u-icon name="heart-fill" color="#ff0000" size="20"></u-icon>
								<view class=" sanshier xiaohei">期望<text v-if="qingshaonian!=1">对象</text>：{{item.userdt.qwdx}}</view>
							</view>
							<view class="margin_top sanshier xiaohei">{{item.userdt.content}}</view>
							<view class="flexleft flex_wrap">
								<view class="sanshis flexcenter margin_top"
									v-for="(ite,inde) in item.userdt.images_text" :key="inde">
									<image class="dtbabb" :src="ite" mode=""></image>
								</view>
							</view>
							<view class="flexbetween margin_top">
								<view class="ershiw flexcenter">
									<view class="flexleft">
										<view class="dticon">
											<image src="../static/image/system/s.png" mode=""></image>
										</view>
										<view class="smalltext xiaohei">{{item.userdt.zs_num}}</view>
									</view>
								</view>
								<view class="ershiw flexcenter">
									<view class="flexleft">
										<view class="dticon">
											<image src="../static/image/system/fx.png" mode=""></image>
										</view>
										<view class="smalltext xiaohei">{{item.userdt.share_num}}</view>
									</view>
								</view>
								<view class="ershiw flexcenter">
									<view class="flexleft">
										<view class="dticon">
											<image src="../static/image/system/xx.png" mode=""></image>
										</view>
										<view class="smalltext xiaohei">{{item.userdt.comment_num}}</view>
									</view>
								</view>
								<view class="ershiw flexcenter">
									<view class="flexleft">
										<view class="dticon">
											<image src="@/static/image/system/dzs.png" mode=""></image>
										</view>
										<view class="smalltext xiaohei">{{item.userdt.dz_num}}</view>
									</view>
								</view>
							</view>
						</view>
						<view class="margin_top strongtext xiaohui textcenter ">已经到底了哦~</view>
					</view>
				</view>
			</view>
			<template v-if="isSH">
				<view class="textcenter xiaohui smalltext margin_top6">永顺县岐越网络科技有限公司 版权所有</view>
				<view class="textcenter xiaohui smalltext" style="padding-bottom: 50rpx;">Copyright 2023-2024</view>
			</template>

		</view>
		<moDal :message="modal" @modalSure="modalSure" @modalcancel="modalcancel"></moDal>
		<yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" :permissionID="permissionID"></yk-authpup>
		<tabbardi ref="tabbardiref" :current="4"></tabbardi>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	import ykAuthpup from "@/components/yk-authpup/yk-authpup";
	export default {
		data() {
			return {
				isActive: 0,
				navList: [{
					index: 0,
					title: '作品'
				}, {
					index: 1,
					title: "动态"
				}, {
					index: 1,
					title: "收藏"
				}, {
					index: 1,
					title: "喜欢"
				}],
				show: false,
				hzshow: false, //合作
				kfshow: false, //客服
				current: 1,
				is_login: false,
				userInfo: {},
				systeminfo: {},
				myAll: [{ //我的作品
						url: "/api/videocl/myVideoIndex",
						page: 1,
						list: {
							data: []
						}
					},
					{ //我的动态
						url: "/api/userdtcl/myDtIndex",
						page: 1,
						list: {
							data: []
						}
					},
					{ //我的收藏-视频
						url: "/api/user/myVideoCollect",
						page: 1,
						list: {
							data: []
						}
					},
					{ //我的收藏-动态
						url: "",
						// url: "/api/user/myDtCollect",
						page: 1,
						list: {
							data: []
						}
					},
					{ //我的收藏-商品
						// url: "",
						url: "/api/user/myGoodsCollect",
						page: 1,
						list: {
							data: []
						}
					},
					{ //我的喜欢-视频
						url: "/api/user/myVideoDz",
						page: 1,
						list: {
							data: []
						}
					},
					{ //我的喜欢-动态
						url: "/api/user/myDtDz",
						page: 1,
						list: {
							data: []
						}
					},
				],
				myAllindex: 0,
				modal: {
					modalShow: false,
					title: "是否删除当前动态？",
				},
				currentid: "",
				statusBarHeight: 0,
				op: 0,
				permissionID: '',
				callphonenum: "",
				isSH: false,
				latitude:"",
				longitude:"",
				qingshaonian:1

			}
		},
		onLoad() {
			uni.hideTabBar()
			this.system()
			this.getsystem()
			uni.getSystemInfo({
				success: (res) => {
					this.statusBarHeight = res.statusBarHeight
				}
			})
			
		},
		onPageScroll(res) {
			let top = res.scrollTop
			let height = this.statusBarHeight + 44
			if (top <= height) {
				this.op = Math.round(top / height * 100) / 100
			} else {
				this.op = 1
			}
		},
		onShow() {
			this.qingshaonian = uni.getStorageSync("qingshaonian") || 0
			setTimeout(()=>{
				this.$refs.tabbardiref.noreadNum = 0
				this.$refs.tabbardiref.getnoreadNum()
			},100)
			this.is_login = httpRequest.checkIsLogin();
			if (this.is_login) {
				this.userinfomsg()
			} else {
				this.userInfo = {}
			}
			this.getlistAll()
		},
		methods: {
			
			getsystem() {
				let _this = this
				let system = uni.getSystemInfoSync()
				let version_code = system.appVersionCode
				let platform = system.platform
				httpRequest.request('/api/index/checkApply', 'GET', {
					platform,
					version_code
				}).then(res => {
					console.log(version_code, platform, res);
					this.isSH = res.data
					if(!this.isSH){//如果不是审核版本再掉更新用户经纬度接口
						uni.getLocation({
							type: 'wgs84',
							success: function(res) {
								uni.hideLoading()
								_this.latitude = res.latitude
								_this.longitude = res.longitude
								_this.setuserlat()
							},
							fail(err) {
								uni.hideLoading()
								httpRequest.toast("定位获取失败，请前往设置开启定位权限")
							}
						});
					}
				})
			},
			setuserlat(){
				httpRequest.request('/api/user/profile', 'GET', {latitude:this.latitude,longitude:this.longitude,}).then(res => {})
			},
			//打开自定义权限目的弹框
			onPhone() {
				let system = uni.getSystemInfoSync()
				let version_code = system.appVersionCode
				let platform = system.platform
				if (uni.getSystemInfoSync().brand.toLowerCase() != 'huawei') {
					this.callphone(this.callphonenum)
					return false
				}
				this.permissionID =
					'CALL_PHONE'; //这个是对应的权限 ACCESS_FINE_LOCATION 位置权限 / WRITE_EXTERNAL_STORAGE 存储空间/照片权限 / CAMERA相机权限 / CALL_PHONE 拨打电话
				setTimeout(() => {
					this.$refs['authpup'].open();
				}, 500)
			},
			//用户授权权限后的回调
			changeAuth() {
				this.callphone(this.callphonenum)
			},
			tzspxq(id) {
				uni.navigateTo({
					url: '/pages_homepage/shangpxq?id=' + id
				})
			},
			trashdt(id) {
				this.currentid = id
				this.modal.modalShow = true
			},
			modalSure() {
				if (this.modal.title == "是否删除当前动态？") {
					this.deletedt(this.currentid)
				}
				this.modalcancel()
			},
			modalcancel() {
				this.modal.modalShow = false
			},
			deletedt() {
				httpRequest.request('/api/userdtcl/delUserDt', 'GET', {
					user_dt_id: this.currentid
				}, false, false, true).then(res => {
					httpRequest.toast(res.msg)
					if (res.code == 1) {
						this.init(1)
					}
				})
			},
			shipin(id, userid) {
				console.log("测试");
				uni.navigateTo({
					url: "/pages_homepage/shipin/shipin?id=" + id + "&userid=" + userid
				})
			},
			getlistAll() {
				this.myAll.forEach((item, index) => {
					if (item.url) {
						this.init(index)
					}
				})
			},
			init(index, isPage, page) {
				let _this = this
				let url = this.myAll[index].url
				let data = {
					page: this.myAll[index].page || 1,
					limit: 12,
				}
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = this.myAll[index].list;
						if (isPage == true) {
							this.myAll[index].list.data = dataList.data.concat(resList.data);
						} else {
							this.myAll[index].list = res.data
							this.myAll[index].list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.myAll[this.myAllindex].list;
				let page = _this.myAll[this.myAllindex].page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.myAll[this.myAllindex].page = page;
				_this.init(this.myAllindex, true, page);
			},
			system() {
				httpRequest.request('/api/index/getConfigInfo', 'GET', {}).then(res => {
					this.systeminfo = res.data
				})
			},
			userinfomsg() {
				httpRequest.request('/api/user/index', 'GET', {}).then(res => {
					this.userInfo = res.data
				})
			},
			// 打开客服弹框
			dkkft() {
				this.show = false
				this.kfshow = true
			},
			kfclose() {
				this.kfshow = false
			},
			// 打开合作弹框
			tzkztk() {
				this.show = false
				this.hzshow = true
			},
			hzclose() {
				this.hzshow = false
			},
			selectab(i) {
				if (i == this.current) {
					return false
				}
				this.current = i
				if (this.isActive == 2) {
					if (this.current == 1) {
						this.myAllindex = 3
					}
					if (this.current == 2) {
						this.myAllindex = 4
					}
					if (this.current == 3) {
						this.myAllindex = 5
					}
				}
				if (this.isActive == 3) {
					if (this.current == 1) {
						this.myAllindex = 6
					}
					if (this.current == 2) {
						this.myAllindex = 7
					}
				}
			},
			// 跳转动态详情
			tzdtxq(id) {
				uni.navigateTo({
					url: '/pages_fabu/dongtaixq?id=' + id
				})
			},
			close() {
				this.show = false
			},
			jumper(url) {
				uni.navigateTo({
					url: url
				})
			},
			tdcz() {
				uni.navigateTo({
					url: "/pages_mypage/tuanduicz",
					fail(err) {
						console.log("跳转醋味",
							err)
					}
				})
			},
			rzplg() {
				if (this.userInfo.plg) {
					uni.navigateTo({
						url: "/pages_mypage/tijiaochengg"
					})
				} else {
					uni.navigateTo({
						url: "/pages_mypage/renzhengplg"
					})
				}
			},
			// 跳转关注及粉丝
			tzgywm(i) {
				let data = {
					type: i,
					id: this.userInfo.id,
					name: this.userInfo.nickname
				}
				uni.navigateTo({
					url: '/pages_homepage/guanzhu?msg=' + encodeURIComponent(JSON.stringify(data))
				})
			},
			checked(index) {
				this.isActive = index
				if (this.isActive == 2) {
					if (this.current == 2) {
						this.current = 1
					}
					if (this.current == 1) {
						this.myAllindex = 3
					}
					if (this.current == 2) {
						this.myAllindex = 4
					}
					if (this.current == 3) {
						this.myAllindex = 5
					}
				}
				if (this.isActive == 3) {
					if (this.current == 3) {
						this.current = 1
					}
					if (this.current == 1) {
						this.myAllindex = 6
					}
					if (this.current == 2) {
						this.myAllindex = 7
					}
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.nav {
		position: fixed;
		top: 0rpx;
		left: 0;
		right: 0;
		background: #fff;
		z-index: 1000;
	}

	// 视频盒子样式
	.videobox {
		position: relative;
		width: 33.33%;
		height: 350rpx;
		margin-top: 5rpx;

		image {
			width: 98%;
			height: 100%;
		}

		.videocontent {
			bottom: 0;
			left: 0;
			position: absolute;
			padding: 10rpx;
		}
	}

	// 视频盒子样式结束
	.webxhx {
		text-decoration: underline;
	}

	.sptup {
		width: 124rpx;
		height: 124rpx;
	}

	.focustext {
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #999999;
	}

	.nofocustext {
		width: 96rpx;
		height: 54rpx;
		background: #F2F2F2;
		border-radius: 27rpx;
		font-size: 24rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-weight: bold;
		color: #333333;
	}

	.jbzlbtn {
		width: 468rpx;
		height: 88rpx;
		background: #F5F5F5;
		border-radius: 40rpx;
	}

	.tcicopn {
		width: 40rpx;
		height: 40rpx;
	}

	.qbicon {
		width: 32rpx;
		height: 32rpx;
	}

	.huibtn {
		width: 214rpx;
		height: 72rpx;
		background: #F5F5F5;
		border: 1px solid #F2F2F2;
		border-radius: 36rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #333333;
	}

	.wbox {
		padding: 25rpx;
		border-radius: 50%;
		background-color: #f2f2f2;
	}

	.navbox {
		position: fixed;
		top: 0rpx;
		left: 0;
		right: 0;
		padding: 30rpx;
		background: #fff;
	}

	.dticon {
		width: 32rpx;
		height: 32rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.dtbabb {
		width: 224rpx;
		height: 224rpx;
	}

	.xiaotux {
		width: 64rpx;
		height: 64rpx;
		border-radius: 50%;
	}

	.tab_nav {
		background-color: #fff;
		display: flex;
		justify-content: center;
		align-items: center;
		padding-bottom: 11rpx;
	}

	.tab_nav .navTitle {
		height: 90rpx;
		line-height: 90rpx;
		width: 100%;
		text-align: center;
		font-size: 30rpx;
		font-weight: bold;
		color: #999999;
	}

	.active {
		font-size: 30rpx;
		color: #333333;
		font-weight: bold;
		position: relative;
	}

	.active::after {
		content: "";
		position: absolute;
		width: 36rpx;
		height: 6rpx;
		background: #000000;
		border-radius: 3rpx;
		background-size: 100% 100%;
		left: 0rpx;
		right: 0rpx;
		bottom: 0rpx;
		margin: auto;
	}

	.xhbtn {
		padding: 10rpx 20rpx;
		background: #F5F5F5;
		border-radius: 20rpx;
	}

	.zhixiang {
		width: 20rpx;
		height: 20rpx;
	}

	.fuzhi {
		width: 24rpx;
		height: 24rpx;
	}

	.xlbtn {
		padding: 5rpx 10rpx;
		border: 1rpx solid #2361FF;
	}

	.dhbtn {
		background: #F5F5F5;
		border-radius: 44rpx;
		padding: 30rpx 68rpx;
	}

	.labtn {
		width: 256rpx;
		height: 88rpx;
		background: #2361FF;
		border-radius: 44rpx;
	}

	.touxiang {
		width: 192rpx;
		height: 192rpx;
		border-radius: 50%;
	}

	.zuytu {
		width: 100%;
		height: 300rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.dingbu {
		background-size: 100% 100%;
		width: 100%;
		position: absolute;
		top: 40rpx;
		padding: 30rpx;
		left: 0;
		box-sizing: border-box;
	}

	.baibox {
		background: #FFFFFF;
		border-radius: 40rpx 40rpx 0 0;
	}

	.dbicon {
		width: 48rpx;
		height: 48rpx;
	}

	// .dingbu {

	// 	padding: 88rpx 30rpx 130rpx;
	// 	background-size: 100% 100%;
	// 	width: 100%;
	// 	background-image: url('../static/image/system/zybjt.png');
	// 	box-sizing: border-box;
	// }
</style>